package com.atguigu.springboot.entity;

import lombok.Data;

import javax.persistence.*;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/25 20:18:12 周三
 * @description :
 *         <p>
 *         使用JPS注解配置映射关系
 *         - @Entity 告诉JPS这是一个实体类(和数据表映射的类)
 *         - @Table(name = "user") 来指定和哪个数据表对应;如果省略默认表名就是类名小写
 *         - @Column(name = "last_name", length = 50) 省略默认列名就是属性名
 *         </p>
 */
@Data
@Entity
@Table(name = "user")
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "last_name", length = 50)
    private String lastName;
    private String email;
}
